from django.conf.urls.defaults import patterns, include, url
from gallery.items.models import Item,Photo

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('django.view.generic',
    # Examples:
    url(r'^$', 'simple.direct_to_template', 
	    kwargs={
		    'template':'index.html',
		    'extra_context':{'item_list':lambda:Item.objects.all()}
		    },
	    name='index'
	    ),
    url(r'^items/$','list_detail.object_list',
	    kwargs={
		    'queryset':Item.objects.all(),
		    'template_name':'items_list.html',
		    'allow_empty':True
		    },
	    name='item_list'
	    ),
    url(r'^items/(?P<object_id>\d+)/$','list_detail.object_detail',
	    kwargs={
		    'queryset':Item.objects.all(),
		    'temlate_name':'items_detail.html'
		    },
	    name='iteml_detail'
	    ),
    url(r'^photo/(?<object_id>\d+/$','list-detail.object-detail',
	    kwargs={
		    'queryset':Photo.objects.all(),
		    'template_name':'photo_detail.html'
		    },
	    name='photo_detail'
	    ),
	    
    # url(r'^gallery/', include('gallery.items.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
)
